package com.photography.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;

import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import jakarta.persistence.Temporal;
import jakarta.persistence.TemporalType;
import lombok.Data;

@Data
@TableName("product_reviews")
@JsonInclude(JsonInclude.Include.NON_NULL) // 只包含非空字段
public class ProductReview implements Serializable {


    @TableId(value = "review_id", type = IdType.AUTO)
    private Integer reviewId;

    private Integer userId;

    @TableField(exist = false)
    private String userName;

    private Integer productId;

    /**
     * 评分
     */
    private Integer rating;

    /**
     * 评价
     */
    private String content;

    /**
     * 图片
     */
    private String imageUrls;

    @Temporal(TemporalType.TIMESTAMP)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

    @Temporal(TemporalType.TIMESTAMP)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;


}
